<form class='form form-horizontal validate-form' style='margin-bottom: 0;' th:object="${result}" id="editForm"
	role="form" action="#" th:action="@{/resource/edit.gsp}" method="post">
	<input th:field="*{id}" type="hidden" /> <input th:field="*{parentId}" type="hidden" hidden="true" />
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">修改资源信息</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class='control-group'>
				<label class='control-label' for='type'> 资源类型： </label>
				<div class="controls">
					<select class="form-control" th:field="*{type}">
						<option value="1">菜单</option>
						<option value="2">按钮</option>
					</select>
				</div>
			</div>
			<div class='control-group'>
				<label class='control-label' for='resourceName'> 资源名称： </label>
				<div class="controls">
					<input th:field="*{resourceName}" placeholder="请输资源名称" type="text" class="form-control" />
				</div>
			</div>
			<div class="control-group">
				<label class='control-label' for='permission'> 资源标志： </label>
				<div class="controls">
					<input th:field="*{permission}" placeholder="请输资源标志" type="text" class="form-control" />
				</div>
			</div>
			<div class="control-group">
				<label class='control-label' for='permValue'>资源URI：</label>
				<div class="controls">
					<input th:field="*{permValue}" placeholder="请输资源URI" type="text" class="form-control" />
				</div>
			</div>
			<div class="control-group">
				<label class='control-label' for='codeNum'>资源代码：</label>
				<div class="controls">
					<input th:field="*{codeNum}" placeholder="请输资源代码" type="text" class="form-control" />
				</div>
			</div>
			<div class="control-group">
				<label class='control-label' for='iconCls'>icon名称：</label>
				<div class="controls">
					<input th:field="*{iconCls}" placeholder="请输icon名称" type="text" class="form-control" />
				</div>
			</div>
			<div class="control-group">
				<label class='control-label' for='sortOrder'> 排序： </label>
				<div class="controls">
					<input class="form-control" value="0" placeholder="请输入排序" type="text" th:field="*{sortOrder}" />
				</div>
			</div>
			<div class="control-group">
				<label class='control-label' for='description'>资源简介：</label>
				<div class="controls">
					<textarea class="form-control" placeholder="最多输入140字" th:field="*{description}"></textarea>
				</div>
			</div>
		</div>
	</div>
	<div class="modal-footer">
        <button class="btn btn-primary" type="submit">
            <strong>提 交</strong>
        </button>
        <button type="button" class="btn btn-default" data-dismiss="modal">
            <strong>关 闭</strong>
        </button>
    </div>
</form>
<script th:inline="javascript">
	/*_$tag____*/
	$(function() {
		var rules = {
			resourceName : {
				required : true,
				maxlength : 20
			},
			permission : {
				required : true,
				maxlength : 50
			},
			permValue : {
				maxlength : 100
			},
			code : {
				maxlength : 80
			},
			iconCls : {
				maxlength : 30
			},
			sortOrder : {
				required : true,
				max : 99
			},
			description : {
				maxlength : 140
			}
		}
		var messages = {

		}
		tg_baseFormAjaxSubmit("editForm", rules, messages, function() {
			location.href = /*[[@{/resource/list.gsp}]]*/'';
		});
	});
	/*_$t*/
</script>
